package Day2025_03_03;

public class HomeWork05 {
    int sum = 0;
    public int sum(int m, int n) {
        dfs(m, n, 0);
        return sum;
    }

    private void dfs(int m, int n, int k) {
        if (n == 0) {
            if (m == 0) sum++;
            return;
        }
        for (int i = k; i <= m; i++) dfs(m - i, n - 1, i);
    }

    public static void main(String[] args) {
        HomeWork05 homeWork05 = new HomeWork05();
        System.out.println(homeWork05.sum(4, 3));
    }
}
